// SPDX-License-Identifier: GPL-2.0
/*
 * KMEMLEAK
 *
 *  - KERNEL: ENABLE CONFIG_DEBUG_KMEMLEAK
 *
 * (C) 2024.05.19 BiscuitOS <buddy.zhang@aliyun.com>
 */
#include <linux/init.h>
#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/slab.h> 

static int __init BiscuitOS_init(void)
{
	void *mem;

	/* ALLOC MEMORY */
	mem = kmalloc(128, GFP_KERNEL);
	if (!mem)
		return -ENOMEM;

	/* DIRECT MEMORY LEAK */
	; /* DONT RECLAIM */

	return 0;
}

static void __exit BiscuitOS_exit(void) { }

module_init(BiscuitOS_init);
module_exit(BiscuitOS_exit);

MODULE_LICENSE("GPL");
MODULE_AUTHOR("BiscuitOS <buddy.zhang@aliyun.com>");
MODULE_DESCRIPTION("BiscuitOS MEMORY LEAK");
